Skip to content

Show-source should not raise error even if line_no is wrong - #1145

Merged
tompng merged 1 commit into
ruby:masterfrom
tompng:source_location_less_line
Dec 4, 2025
Merged

Show-source should not raise error even if line_no is wrong#1145
tompng merged 1 commit into
ruby:masterfrom
tompng:source_location_less_line

Conversation

@tompng

@tompng tompng commented Dec 3, 2025

Copy link
Copy Markdown
Member

Fix SourceFinder to handle wrong line_no case, such as:

  • line_no passed to eval is wrong
  • File edited after load

An example I actually experienced was:

  1. Run irb with irb -rlibname -Ilib
  2. Switch to another branch
  3. Run show_source

Fix SourceFinder to handle wrong line_no case, such as:
- line_no passed to eval is wrong
- File edited after load
@st0012 st0012 added the bug Something isn't working label Dec 4, 2025
@tompng
tompng merged commit 6d7ff96 into ruby:master Dec 4, 2025
33 checks passed
@tompng
tompng deleted the source_location_less_line branch December 4, 2025 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants